package mysqlinit

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	GoodsTitle string  `gorm:"type:varchar(20)"`
	GoodsPrice float64 `gorm:"type:decimal(10,2)"`
	GoodsNum   int     `gorm:"type:int(11)"`
}

func (g *Goods) CreateGoods() error {
	return DB.Debug().Create(&g).Error
}

func (g *Goods) FindGoods() error {
	return DB.Debug().Find(&g).Error
}
